<template>
  <el-row :gutter="40" class="panel-group">
    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
      <div class="card-panel  big1" @click="handleSetLineChartData('newVisitis')" style="margin-left: 0px;">
        <div class="box1">
          <p class="s1">今日收款总额</p>
          <p class="s2">2000</p>
        </div>
        <div class="box2">
          <p class="p1">成功率</p>
          <p class="p2">45.9%</p>
        </div>
        <div class="box3">
          <p class="p1">(1007/2209)</p>
        </div>
      </div>
    </el-col>
    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
      <div class="card-panel big2" @click="handleSetLineChartData('messages')">

        <div class="box1">
          <p class="s1">昨日收款总额</p>
          <p class="s2">2000</p>
        </div>
        <div class="box2">
          <p class="p1">成功率</p>
          <p class="p2">45.9%</p>
        </div>
        <div class="box3">
          <p class="p1">(1007/2209)</p>
        </div>
      </div>
    </el-col>
    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
      <div class="card-panel big3" @click="handleSetLineChartData('purchases')">
        <div class="box1">
          <p class="s1">今日收款总额</p>
          <p class="s2">2000</p>
        </div>
        <div class="box2">
          <p class="p1">成功率</p>
          <p class="p2">45.9%</p>
        </div>
        <div class="box3">
          <p class="p1">(1007/2209)</p>
        </div>
      </div>
    </el-col>
    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
      <div class="card-panel big4" @click="handleSetLineChartData('shoppings')">
        <div class="box1">
          <p class="s1">平台总利润</p>
          <p class="s2">2000</p>
        </div>
        <div class="box2" style="justify-content: flex-start;">
          <p class="p1">收款/代付/充值</p>
        </div>
        <div class="box3" style="justify-content: flex-start;">
          <p class="p1">674.28 /125 /48</p>
        </div>
      </div>
    </el-col>
  </el-row>
</template>

<script>
import CountTo from 'vue-count-to'

export default {
  components: {
    CountTo
  },
  methods: {
    handleSetLineChartData(type) {
      this.$emit('handleSetLineChartData', type)
    }
  }
}
</script>

<style lang="scss" scoped>

.panel-group {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-around;

  .card-panel-col {
    height: 160px;
   // background-color: pink;
  }

  .card-panel {
    height: 120px;
    cursor: pointer;
    //font-size: 12px;
    position: relative;
    overflow: hidden;
    color: #fff;
    background: #fff;
    box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
    border-color: rgba(0, 0, 0, .05);
    //background: linear-gradient(138deg, rgba(106, 179, 255, 0.82) 0%, #1D8BFF 97%);
    border-radius: 10px 10px 10px 10px;
    opacity: 1;

    padding-left:24px;
    padding-top: 10px;
    padding-right: 24px;
    margin-left: -25px;
    //color: white;
    box-sizing: border-box;
    .box1,.box2,.box3{
      width: 100%;
      height: 33%;
      display: flex;
      justify-content: space-between;
      align-items: center;
      //background-color: pink;
    }
    .box1{
      //background-color: skyblue;
     // margin-top: -30px;
      .s1{
        font-size: 18px;
        font-weight: 500;
      }
      .s2{
        font-size: 22px;
        font-weight: 600;
      }
    }
    .box2{
      .p1{
        font-weight: 300;
        font-size: 16px;
      }
      .p2{
        font-size: 20px;
      }
    }
    .box3{
      justify-content: flex-end;
      font-size: 16px;
      line-height: 30px;
      align-items: center;
      font-weight: 400;
    }
    &:hover {
      .card-panel-icon-wrapper {
        color: #fff;
      }

      .icon-people {
        background: #40c9c6;
      }

      .icon-message {
        background: #36a3f7;
      }

      .icon-money {
        background: #f4516c;
      }

      .icon-shopping {
        background: #34bfa3
      }
    }

    .icon-people {
      color: #40c9c6;
    }

    .icon-message {
      color: #36a3f7;
    }

    .icon-money {
      color: #f4516c;
    }

    .icon-shopping {
      color: #34bfa3
    }

    .card-panel-icon-wrapper {
      float: left;
      //margin: 14px 0 0 14px;
      padding: 16px;
      transition: all 0.38s ease-out;
      border-radius: 6px;
    }

    .card-panel-icon {
      float: left;
      font-size: 48px;
    }

    .card-panel-description {
      float: right;
      font-weight: bold;
     // margin: 26px;
     // margin-left: 0px;

      .card-panel-text {
        line-height: 18px;
        color: rgba(0, 0, 0, 0.45);
        font-size: 16px;
        margin-bottom: 12px;
      }

      .card-panel-num {
        font-size: 20px;
      }
    }
  }
  .big1{
    background: linear-gradient(138deg, rgba(106,179,255,0.82) 0%, #1D8BFF 97%);
 }
 .big2{
  background: linear-gradient(360deg, #2DD6B6 0%, #49E8C7 100%);
 }
 .big3{
  background: linear-gradient(180deg, #F9D658 0%, #FAB634 100%);
 }
 .big4{
  background: linear-gradient(180deg, rgba(255,154,114,0.82) 0%, #FF8147 100%);
 }
}

@media (max-width:550px) {
  .card-panel-description {
    display: none;
  }

  .card-panel-icon-wrapper {
    float: none !important;
    width: 100%;
    height: 100%;
    margin: 0 !important;

    .svg-icon {
      display: block;
      margin: 14px auto !important;
      float: none !important;
    }
  }
}
</style>
